package com.hspedu.homework;

import java.util.Scanner;

/**
 * @author sp
 * @version 0.1
 * 1.编写应用程序EcmDef.java, 接收命令行的两个参数（整数），计算两数相除
 * 2.计算两个数相处，要求使用方法cal(int n1, int n2)
 * 3.对数格式不正确、缺少命令行参数、除0 进行异常处理
 */
public class Homework01 {
    public static void main(String[] args) {
        EcmDef ecmDef = new EcmDef();
        ecmDef.method();
    }
}

class EcmDef {
    public void method() {
        Scanner scanner = new Scanner(System.in);
        try {
            int sum = scanner.nextInt();
            int sum2 = scanner.nextInt();
            System.out.println((sum / sum2));
        } catch (NumberFormatException e) {
            System.out.println("数据格式不正确: "+ e.getMessage());
        } catch (ArithmeticException e){
            System.out.println("算数运算错误：" + e.getMessage());
        }



    }
}